<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><s:text name="hotKeywordRule.list.title"/></title>
	<%@ include file="/common/meta.jsp"%>
	<%@ include file="/common/common.jsp"%>
	<sx:head/> 
</head>
<body>
<div id="wrapper">
	<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/main.action"><s:text name="homepage"/></a><span>></span><a href="#">关键字规则管理</a></div>
	<div class="listtit" id="listtit"><p><span><strong>关键字规则</strong></span></p></div>
	<s:form action="hotkeywordrule-save" id="search_form">

	<div class="listadd">
		<table class="addgrid">
			<tbody>
				<s:iterator value="page.result" status="st">
					<tr>
						<%-- <td><input type="checkbox" name="key" value="<s:property value="hotKeywordRuleId"/>"/></td> --%>
					<%-- <td><s:property value="itemCode"/>&nbsp;</td> --%>
					<td><tt class="red">*</tt><s:property value="itemName"/>&nbsp;</td>
					<td><input type="text" class="txtin mm5" id="<s:property value='hotKeywordRuleId'/>" name="hotKeywordRule.itemValue" onblur="chkItemValue();" value="<s:property value='itemValue'/>" onkeyup="this.value=this.value.replace(/\D/g,'')" onchange="this.value=this.value.replace(/\D/g,'')" />次
						<s:if test="%{authLicence('1_1_8')}">
							<a href="#this" onclick="submitVal('<s:property value="hotKeywordRuleId"/>')">提交</a><span class="keyerror" id="itemValue-Message<s:property value="hotKeywordRuleId" />" />
						</s:if>
					</td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		</div>
		</s:form>
	</div>
</div>
</body>
</html>
<script type="text/javascript" defer="defer">
	actionName = "hotkeywordrule";	
	confirmStr = "<s:text name="delete.confirm"/>";
	chiocenothing = "<s:text name="chiocenothing"/>";
	
	function submitVal(id) {
		var itemValue = $("#"+id).val();
		var obj = {"hotKeywordRule.itemValue":itemValue,"hotKeywordRule.hotKeywordRuleId":id};
		if(itemValue=='') {
			$("#itemValue-Message" + id).html('数值不能为空！');
			return false;
		}else {
			$("#itemValue-Message" + id).html('');
			$.post("${ctx}/search/hotkeywordrule-submitvalue.action",obj,function(data){
				if(data=="ok") {
					alert('提交成功');
				}else {
					alert('提交失败');
				}
				
			});	
			
		}
		
	}
	
	
	</script>